<html>

<head>
	<title>会飞的猪</title>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
	<!-- 定制版 ionic 样式 -->
	<link rel="stylesheet" href="../css/editormd.css" />
	<link rel="stylesheet" href="https://unpkg.com/vonic@2.0.0-beta.11/dist/vonic.min.css">
	<script src="../js/jquery.min.js"></script>
	<script src="../lib/jquery.cookie.js"></script>
	<script src="../lib/c.js"></script>
	<script src="../js/a.js"></script>
	<script src="https://cdn.jsdelivr.net/npm/leancloud-storage@3.14.1/dist/av-live-query-min.js"></script>
	<script src="js/net.js"></script>
	<script src="page/patch.js"></script>
	<script src="../lib/vue-marked.js" type="text/javascript"></script>
	<!-- 依赖库 axios/vue/vue-router -->
	<script src="../js/axios.js"></script>
	<script src="../js/vue.js"></script>
	<script src="../js/vue-router.js"></script>
	<script src="../js/vuex.js"></script>
	<script src="../lib/marked.min.js"></script>
	<script src="../lib/prettify.min.js"></script>
	<script src="../editormd.js"></script>
	<!-- vonic 核心文件 -->
	<script src="../js/vonic.min.js"></script>
</head>

<body>
	<!-- mount point -->
	<von-app></von-app>
	<!-- templates -->
	<script type="x-template" id="index">

			<div class="page">
        <div class="page-content text-center">
		<div class="centerV login">
			<div style="margin-top: -15rem;">
				
			
          <h2 class="padding">{{msg}}</h2>
          <von-input 
          type="text" 
		   v-model="bean.name" 
          placeholder="用户名/手机/邮箱" 
          label="用户名">
        </von-input>
		<div class="space">		
		</div>
        <von-input 
        type="password" 
        placeholder="密码" 
		  v-model="bean.pwd" 
        label="密码">
      </von-input>
	  <div class="space">
	  </div>
      <md-button class="button button-assertive button-block "@click.native="loginAction()">
            登录
          </md-button>
   </div>
          </div>
        </div>
      </div>
    </script>
	<script type="x-template" id="mdViewer">
			<div class="page">
			
				<von-header theme="light">
					<button class="button button-icon ion-ios-arrow-back" slot="left" @click="back()"></button>
				  <span slot="title">{{mdName}}</span>
				</von-header>
				<scroll class="page-content"   :on-refresh="onRefresh">
						<div id="overMd" style="padding:10px"></div>
				</scroll>
				
			  </div>
	</script>
	<script type="x-template" id="pwd">

			<div class="page">
				<von-header theme="light">
					<button class="button button-icon ion-ios-arrow-back" slot="left" @click="back()"></button>
				  <span slot="title">修改密码</span>
				</von-header>
				
				  <div class="page-content text-center">
						<div class="centerV">
							<div style="margin-top: -15rem;">
								
				   
				  <von-input 
				  type="password" 
				  placeholder="密码" 
						  v-model="bean.pwd" 
				  label="旧密码">
				</von-input>
				<div class="space">
				</div>
				<von-input
				  type="password" 
				  placeholder="密码" 
						  v-model="bean.pwd" 
				  label="新密码">
				</von-input>
					
						<div class="space">		
						</div>
				<md-button class="button button-assertive button-block "@click.native="loginAction()">
				      保存
				    </md-button>
					</div>
				</div>
			  </div>
			  </div>
	</script>
	<script type="x-template" id="main">
			<div class="page" v-tabbar="{'menus': menus, menuColor: '#B5B5B5', activeMenuColor: '#44CC00', onMenuClick: menuClicked}">
                    <router-view></router-view>
                  </div>
    </script>
	<script type="x-template" id="home">
			<div class="page has-navbar has-tabbar" v-tabbar-menu-index="0">
              <von-header theme="light">
                <span slot="title">首页</span>
              </von-header>
              <div class="page-content padding-top">
                <p class="text-center">首页我也不知道做点啥</p>
              </div>
            </div>
          </script>



	<script type="x-template" id="md">
			<div class="page has-navbar has-tabbar" v-tabbar-menu-index="1">
                  <von-header theme="light">
                    <span slot="title">我的文章</span>
				  </von-header>
				
				
                  <scroll class="page-content"
                          :on-refresh="onRefresh"
						  :on-infinite="onInfinite">
						  <search v-model="keywords" placeholder="输入文章名称" :on-search="onSearch"></search>
                    <item v-for="(item, index) in items" @click.native="onItemClick(index)" :class="{'item-stable': index % 2 == 0}">
                      {{ item.name }}
                    </item>
                        
                    <div v-if="noMore" slot="infinite" class="text-center">没有更多数据</div> 
				  </scroll>
				</div>
                
			  </script>
	<script type="x-template" id="groupMd">
			<div class="page">
			
				<von-header theme="light">
					<button class="button button-icon ion-ios-arrow-back" slot="left" @click="back()"></button>
				  <span slot="title">{{groupName}}</span>
				</von-header>
				
				
                  <scroll class="page-content"
                          :on-refresh="onRefresh"
						  :on-infinite="onInfinite">
						  <search v-model="keywords" placeholder="输入文章名称" :on-search="onSearch"></search>
                    <item v-for="(item, index) in items" @click.native="onItemClick(index)" :class="{'item-stable': index % 2 == 0}">
                      {{ item.name }}
                    </item>
                        
                    <div v-if="noMore" slot="infinite" class="text-center">没有更多数据</div> 
				  </scroll>
				</div>
                
			  </script>
	<script type="x-template" id="group">
			<div class="page has-navbar has-tabbar" v-tabbar-menu-index="2">
                  <von-header theme="light">
                    <span slot="title">我的群组</span>
				  </von-header>
				
				
                  <scroll class="page-content"
                  :on-refresh="onRefresh"
				  :on-infinite="onInfinite">
				  <search v-model="keywords" placeholder="输入群组名称" :on-search="onSearch"></search>
            <item v-for="(item, index) in items" @click.native="onItemClick(index)" :class="{'item-stable': index % 2 == 0}">
              {{ item.groupName }}
            </item>
      
            <div v-if="noMore" slot="infinite" class="text-center">没有更多数据</div>
		  </scroll>
		
                </div>
              </script>
	<script type="x-template" id="user">
			<div class="page has-navbar has-tabbar" v-tabbar-menu-index="3">
                  <von-header theme="light">
                    <span slot="title">关于</span>
                  </von-header>
				  <div class="page-content" style="padding-top: 54px;">
						<div class="item item-divider">
						 管理
						</div>
			  
						
						<item class="item-icon-left">
								{{bean.name}}
						  <i class="icon ion-social-github dark"></i>
						</item>
					
						<item class="item-icon-right">
						  成员等级
						  <span class="item-note">{{bean.power}}</span>
						  <i class="icon ion-ios-arrow-right" style="color: #DDD;"></i>
						</item>
			  <item class="item-icon-right" @click.native="changePwd()">
			    修改密码
			    <span class="item-note"></span>
			    <i class="icon ion-ios-arrow-right" style="color: #DDD;"></i>
			  </item>
						<div class="item item-divider">
						  关于作者
						</div>
			  
						<list class="list-ios">
							<item class="item-icon-right">
							  当前版本
							  <span class="item-note">1.0</span>
							  <i class="icon ion-ios-arrow-right" style="color: #DDD;"></i>
							</item>
						  <item class="item-icon-right">
						    作者
							<a class="item-note" target="view_window" style=" text-decoration:none" href="https://zyqing.ml">会飞的猪</a>
						    <i class="icon ion-ios-arrow-right" style="color: #DDD;"></i>
						  </item>
						 
						  <item>
							帮助我做的更好
						  </item>
						</list>
			  
						<md-button class="button button-assertive button-block "@click.native="loginOut()">
								退出登录
							  </md-button>
			  
						<div style="height: 100px"></div>
					  </div>
                </div>
            </script>
	<script>
		$.MdManager.initJS()
		$.Encryption.user.init()
		// Page Components
		patchPage.loadJS('page/Index.js')
		patchPage.loadJS('page/Main.js')
		patchPage.loadJS('page/Home.js')
		patchPage.loadJS('page/User.js')
		patchPage.loadJS('page/Group.js')
		patchPage.loadJS('page/mdViewer.js')
		patchPage.loadJS('page/groupMd.js')
		patchPage.loadJS('page/MdView.js')
		patchPage.loadJS('page/Pwd.js')

		patchPage.loadReady(function () {
			var routes = [{
				path: '/',
				component: Index
			},
			{
				path: '/main/mdViewer',
				component: mdViewer
			},
			{
				path: '/main/pwd',
				component: Pwd
			},
			{
				path: '/main/groupMd',
				component: groupMd,
				name: 'groupMd'
			},
			{
				path: '/main',
				component: Main,
				children: [{
					path: 'home',
					component: Home
				},
				{
					path: 'md',
					component: MdView
				},

				{
					path: 'group',
					component: Group
				},
				{
					path: 'user',
					component: User
				}
				]
			}
			]
			Vue.use(Vonic.app, {
				routes: routes
			})
		})

		function juageLogin(that) {
			if (!($.Encryption.user.isLogin())) {
				$dialog.alert({
					// 效果
					effect: 'default',
					// 标题
					title: '提示',
					// 内容
					content: '您没有登录',
					// 按钮文本
					okText: '确定',
					// 按钮主题
					okTheme: 'assertive'
				})
				that.$router.push('/')
				return true
			}
			return false

		}
	</script>
</body>
<style>
	.centerV {
		width: 100%;
		height: 100%;
		display: flex;
		justify-content: center;
		flex-direction: column;
	}

	.login {
		padding: 1.5rem;
	}

	#overMd {
		position: relative;
		background-color: white
	}

	.space {
		width: 100%;
		height: 1rem;
	}
</style>
<!-- showCustomPopup2() {
	let options = {
		effect: 'scale',
		title: '',
		buttons: [
			{ text: '确定', theme: 'assertive' }
		],
		showClose: true
	}
	let template = `<p style="margin-bottom: 10px; text-align: center; font-size: 16px;">带有关闭按钮</p>
					<p style="margin-bottom: 0; text-align: center;">自定义内容</p>`
	let popup = $popup.fromTemplate(template, options)

	popup.show().then((buttonIndex) => {
	  
	})
} -->

</html>